#ifndef CRTP_BASE_HPP
#define CRTP_BASE_HPP

template<typename Derived>
class CrtpBase
{
public:
	const Derived& derived() const;
	      Derived& derived();
};

template<typename Derived>
auto CrtpBase<Derived>::derived() const -> const Derived& {
	return static_cast<const Derived&>(*this);
}

template<typename Derived>
auto CrtpBase<Derived>::derived() -> Derived& {
	return static_cast<Derived&>(*this);
}

#endif